package com.web.mapper;

import com.web.pojo.MessageWall;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MessageMapper {
    @Select("select * from yan.messagewall")
    List<MessageWall> findAllMessage();

    @Insert("INSERT INTO yan.messagewall(message,color,date,name,label)VALUES(#{message}, #{color}, #{date}, #{name}, #{label})")
    int InsertMessage(MessageWall messageWall);

    @Delete("DELETE FROM yan.messagewall WHERE id=#{id};")
    int DeleteMessage(int id);
}
